package com.visionblue.business.ship.model.repository

import android.content.SharedPreferences
import com.visionblue.business.ship.util.ext.SingletonHolderSingleArg
import com.visionblue.business.ship.util.ext.float
import com.visionblue.business.ship.util.ext.string

/**
 * @author: xlh
 * @date: 2020-07-22 8:21 AM
 * @desc:
 */
class FlowVolumeRepository private constructor(prefs: SharedPreferences) {

    var lastInWaterVolume: String by prefs.string("lastInWaterVolume", "")
    var totalInWaterErrorVolume: Float by prefs.float("totalInWaterErrorVolume")

    var lastInWasteWaterVolume: String by prefs.string("lastInWasteWaterVolume", "")
    var totalInWasteWaterErrorVolume: Float by prefs.float("totalInWasteWaterErrorVolume")

    var lastInOilVolume: String by prefs.string("lastInOilVolume", "")
    var totalInOilErrorVolume: Float by prefs.float("totalInOilErrorVolume")

    var lastOutWaterVolume: String by prefs.string("lastOutWaterVolume", "")
    var totalOutWaterErrorVolume: Float by prefs.float("totalOutWaterErrorVolume")

    var lastOutWasteWaterVolume: String by prefs.string("lastOutWasteWaterVolume", "")
    var totalOutWasteWaterErrorVolume: Float by prefs.float("totalOutWasteWaterErrorVolume")

    var lastOutOilVolume: String by prefs.string("lastOutOilVolume", "")
    var totalOutOilErrorVolume: Float by prefs.float("totalOutOilErrorVolume")

    var lastInSonicVolume: String by prefs.string("lastInSonicVolume", "")
    var totalInSonicErrorVolume: Float by prefs.float("totalInSonicErrorVolume")

    var lastOutSonicVolume: String by prefs.string("lastOutSonicVolume", "")
    var totalOutSonicErrorVolume: Float by prefs.float("totalOutSonicErrorVolume")

    companion object :
        SingletonHolderSingleArg<FlowVolumeRepository, SharedPreferences>(::FlowVolumeRepository)
}